define(
    function (require) {
        var BaseListAction = require('common/ListAction');

        function ListAction() {
            BaseListAction.apply(this, arguments);
        }

        ListAction.prototype.modelType = require('./ListModel');

        ListAction.prototype.viewType = require('./ListView');

        ListAction.prototype.group = 'foodNewProduct';

        ListAction.prototype.initBehavior = function () {
            BaseListAction.prototype.initBehavior.apply(this, arguments);
            var me = this;
            var type = this.model.get('entityName');
            this.view.on(
                'modify',
                function (e) {
                    me.redirect('/' + type + '/update~id=' + e.args);
                }
            );
            this.view.on(
                'create',
                this.redirect.bind(this, '/' + type + '/create')
            );
        };

        require('er/util').inherits(ListAction, BaseListAction);
        return ListAction;
    }
);
